#!/usr/bin/make -f
# You must remove unused comment lines for the released package.
export LC_ALL=C.UTF-8
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

WHICH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)

ifeq ($(WHICH_OS), kfreebsd)
    NOT_LINUX := -DCPULOAD_PLUGIN=NO -DNETWORKMONITOR_PLUGIN=NO -DVOLUME_PLUGIN=NO
endif

ifeq ($(WHICH_OS), hurd)
    NOT_LINUX := -DCPULOAD_PLUGIN=NO -DNETWORKMONITOR_PLUGIN=NO -DVOLUME_PLUGIN=NO -DSENSORS_PLUGIN=NO
endif

%:
	dh $@  --buildsystem cmake

override_dh_auto_configure:
	dh_auto_configure -- -D_FORTIFY_SOURCE=2\
                -DPULL_TRANSLATIONS=OFF \
                -DUPDATE_TRANSLATIONS=OFF \
                -DDOM_PLUGIN=OFF \
                -DCMAKE_BUILD_TYPE=RelWithDebInfo \
                $(NOT_LINUX)


#override_dh_auto_configure:
#	dh_auto_configure -- \
#	      -DCMAKE_LIBRARY_ARCHITECTURE="$(DEB_TARGET_MULTIARCH)"
